package com.dingding.gmall.cart.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author liudingding
 * @ClassName CartItem
 * @description 单个购物项
 * @date 2021/7/29 9:31 下午
 */


public class CartItem {

    private Long skuId;

    /**
     * 商品是否被选中
     */
    private boolean check = true;

    /**
     * 商品标题
     */
    private String title;

    /**
     * 图片
     */
    private String image;

    /**
     * 套餐属性
     */
    private List<String> skuAttr;

    /**
     * 单个购物项的价格
     */
    private BigDecimal price;

    /**
     * 单个购物项的数量
     */
    private Integer itemCount;

    /**
     * 单个购物项的优惠价
     */
    private BigDecimal itemReducePrice = new BigDecimal("0.00");

    /**
     * 单个购物项总价 -> 根据商品数量计算
     */
    private BigDecimal totalPrice;

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public boolean isCheck() {
        return check;
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttr() {
        return skuAttr;
    }

    public void setSkuAttr(List<String> skuAttr) {
        this.skuAttr = skuAttr;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getItemCount() {
        return itemCount;
    }

    public void setItemCount(Integer itemCount) {
        this.itemCount = itemCount;
    }

    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.itemCount));
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getItemReducePrice() {
        return this.itemReducePrice.multiply(new BigDecimal(this.itemCount));
    }

    public void setItemReducePrice(BigDecimal itemReducePrice) {
        this.itemReducePrice = itemReducePrice;
    }

}
